package cn.kuporo.seckill.user.controller;

import cn.kuporo.seckill.common.model.response.Response;
import cn.kuporo.seckill.common.model.vo.UserAddReqVO;
import cn.kuporo.seckill.user.application.service.SeckillUserService;
import cn.kuporo.seckill.user.domain.model.SeckillUser;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: kuporo
 * @since: 2025/7/7
 * @description:
 */
@RestController
@RequestMapping(value = "/user")
@RequiredArgsConstructor
public class SeckillUserController {
    private final SeckillUserService seckillUserService;
    @PostMapping("/login")
    public Response<String> login(@RequestBody @Validated UserAddReqVO userAddReqVO){
        return seckillUserService.login(userAddReqVO);
    }

    @PostMapping("/info")
    public Response<SeckillUser> queryUserInfo(){
        return seckillUserService.queryUserInfo();
    }



}
